from rest_framework import serializers
from Healths.models import HealthCategoryModel, HealthDiseaseModel, LifeCategoryModel, LifeDiseaseModel, HealthInfoModel, LifeInfoModel


# 大众健康-健康分类序列化器类
class HealthCategoryModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = HealthCategoryModel
        fields = ['id', 'name']


# 大众健康-疾病分类序列化器类
class HealthDiseaseModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = HealthDiseaseModel
        fields = ['id', 'name']


# 生活手册-生活分类序列化器类
class LifeCategoryModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeCategoryModel
        fields = ['id', 'name']


# 生活手册-生活技巧序列化器类
class LifeDiseaseModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeDiseaseModel
        fields = ['id', 'name']


# 健康信息序列化器类
class HealthInfoModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = HealthInfoModel
        fields = ['id', 'title', 'content', 'author', 'create_date', 'cover', 'is_pass', 'remark']


# 生活信息序列化器类
class LifeInfoModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeInfoModel
        fields = ['id', 'title', 'content', 'author', 'create_date', 'cover', 'is_pass', 'remark']
